#!/usr/bin/env python3
# -*- coding: utf-8 -*
import time
import os

# 简单示例：每5秒写一条日志
LOG_PATH = os.environ.get('LOG_PATH', '/var/log/myapp.log')

def log(str):
    with open(LOG_PATH, 'a') as f:
        f.write(f"{time.strftime('%Y-%m-%d %H:%M:%S')} - {str}")